import sheep from '@/sheep';
import { formatImageUrlProtocol } from './index';

const details  = (poster) => {


  const width = poster.width;
  const userInfo = sheep.$store('user').userInfo;

  return {
    background: formatImageUrlProtocol(sheep.$url.cdn(sheep.$store('app').platform.share.posterInfo.sign_clock_bg)),
    list: [
      {
        name: 'goodsTitle',
        type: 'text',
        val: poster.shareInfo.poster.title,
        x: width * 0.053,
        y: width * 0.548,
        maxWidth: width * 0.91,
        line: 2,
        lineHeight: 5,
        paintbrushProps: {
          fillStyle: '#666',
          font: {
            fontSize: 15,
            fontWeight:500,
          },
        },
      },
      {
        name: 'goodsDemand',
        type: 'text',
        val: poster.shareInfo.poster.desc,
        x: width * 0.053,
        y: width * 0.740,
        maxWidth: width * 0.91,
        line: 2,
        lineHeight: 5,
        paintbrushProps: {
          fillStyle: '#666',
          font: {
            fontSize: 15,
            fontWeight:500,
          },
        },
      },
      {
        name: 'goodsTime',
        type: 'text',
        val: poster.shareInfo.poster.signUpTime,
        x: width * 0.053,
        y: width * 0.978,
        maxWidth: width * 0.91,
        line: 2,
        lineHeight: 5,
        paintbrushProps: {
          fillStyle: '#666',
          font: {
            fontSize: 15,
            fontWeight:500,
          },
        },
      },
      {
        name: 'goodsEmployeeNeeds',
        type: 'text',
        val: poster.shareInfo.poster.employeeNeeds,
        x: width * 0.053,
        y: width * 1.164,
        maxWidth: width * 0.91,
        line: 3,
        lineHeight: 5,
        paintbrushProps: {
          fillStyle: '#666',
          font: {
            fontSize: 15,
            fontWeight:500,
          },
        },
      },
      // // #ifndef MP-WEIXIN
      // {
      //   name: 'qrcode',
      //   type: 'qrcode',
      //   val: poster.shareInfo.link,
      //   x: width * 0.75,
      //   y: width * 1.3,
      //   size: width * 0.2,
      // },
      // // #endif
      // #ifdef MP-WEIXIN
      {
        name: 'wxacode',
        type: 'image',
        val: sheep.$api.third.wechat.getWxacode(poster.shareInfo.path),
        x: width * 0.05,
        y: width * 1.3,
        width: width * 0.26,
        height: width * 0.26,
      },
      // #endif
    ],
  };
};
// console.log(background)
export default details;
